package interfaz;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
import javax.swing.LayoutStyle.ComponentPlacement;
import java.awt.Font;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.io.IOException;




public class Exito extends JDialog {

	private final JPanel contentPanel = new JPanel();
	private String ciudadFinal;
	private String pesoFinal;
	private String gananciaFinal;
	private Clip sonidoFinal;
	
	
	public Exito(final JFrame frame, boolean b,String cF,String pF,String gF){
	
		super(frame,b);
		this.ciudadFinal=cF;
		this.pesoFinal=pF;
		this.gananciaFinal=gF;;
	
	    try
	     {
		 sonidoFinal=AudioSystem.getClip();
	     sonidoFinal.open(AudioSystem.getAudioInputStream(getClass().getResourceAsStream("/imagenes/temafinal.wav")));
	     sonidoFinal.start();
	     }   
	      
		 catch(UnsupportedAudioFileException ee){} 
		 catch(IOException ea){} 
		 catch(LineUnavailableException LUE){};    	
		
		
	}

	public void configurar() {
		  PnlFondoJDialog pnlFondo = new PnlFondoJDialog(ciudadFinal,pesoFinal,gananciaFinal);
	      setLocationRelativeTo(null);
	      setResizable(false);
	      this.add(pnlFondo, BorderLayout.CENTER);
	      this.pack();
		
	}
}